const {Controller} = require('egg');
let users = [];
class UserController extends Controller {
  async add(){
     await this.ctx.render('user/add',{});
  }
  async doAdd(){
     let user = this.ctx.request.body;
     user.id = users.length>0?users[users.length-1].id+1:1;
     this.ctx.body = user;
  }
}
module.exports = UserController;